import time

user,passwd="alex","abc123"

def auth(func):
    def wrapper(*args,**kwargs):
        user_name=input("Username:").strip()
        pass_word= input("Password:").strip()

        if user==user_name and passwd==pass_word :
            print("\033[32;1m User has passed authentication\033[0m")
            func(*args,**kwargs)
        else:
            exit("\033[31;1m Worng\033[0m")
    return wrapper
def index():
    print("welcome to index page")

@auth
def home():
    print("welcome to home page")

@auth
def bbs():
    print("welcome to bbs page")
index()
home()
bbs()
